﻿<%@ Page Language="C#" Title="mvc 测试页面" MasterPageFile="~/W_View/PageMaster.Master" CodeBehind="T_RdpciPage.aspx.cs" Inherits="STHPMS1.Web.W_View.TestPage.T_RdpciPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/datagrid.js")%>

    <script type="text/javascript">      

        function T_RdpciEdit(flag)
        {
            var row = $('#dg').datagrid('getSelected');
            var title="";
            if (flag == 0)
            {
                if (!row) {
                    $.messager.alert('消息提示', '编辑数据时，请选择一项!', 'warning');
                    return;
                }
                $('#fm').form('load', row);
                title="新增测试数据";
            }
            else
            {
                $('#fm').form('clear');
                title="编辑测试数据";
            }

            $('#dlg').dialog('open');
        }

        function T_RdpciDel() {
            var row = $('#dg').datagrid('getSelected');
            if (!row) {
                $.messager.alert('消息提示', '删除数据时，请选择一项!', 'warning');
                return;
            }

            deleteData($('#dg'), $('#dlg'), "/api/rdpci");
        }



        function search(n,o) {
            var region = $('#cmbRegion').combobox("getValue");
            var direction = $('#cmbDirection').combobox("getValue");
            var checkDate = $('#checkDate').datebox('getValue');  //注意.datebox('getValue')

            var url = '/api/rdpci';
            var urlParam = "";
            if (region != "" && region!="0") urlParam += "region=" + encodeURI(region) + "&";
            if (direction != "" && direction!="0") urlParam += "direction=" + encodeURI(direction) + "&";
            if (checkDate != "") urlParam += "checkDate=" + encodeURI(checkDate) + "&";
            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }

            $('#dg').datagrid({ url:  url,pageNumber:1});
        }
       

        $(function () {
            var number= '<%= Page.RouteData.Values["page"] %>';
            var size = '<%= Page.RouteData.Values["size"] %>';

            dataGridBind($('#dg'), '/api/rdpci', '测试数据列表显示', $('#tb'), number, size);

            $('.validatebox-text').bind('blur', function () {
                $(this).validatebox('enableValidation').validatebox('validate');
            });
        })

        
    </script>    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table id="dg" class="easyui-datagrid content-place"  ajaxCached="false"  >
        <thead>
            <th data-options="field:'Segid',editor:'numberbox',width:80,align:'right' ">路段Id</th>
<th data-options="field:'Device',editor:'checkbox',width:80,align:'right' ">设备</th>
<th data-options="field:'Survtype',editor:'checkbox',width:80,align:'right' ">Survtype</th>
<th data-options="field:'Pcidate',editor:'datebox',width:80,align:'right' ">Pcidate</th>
<th data-options="field:'Pcilane',editor:'checkbox',width:80,align:'right' ">Pcilane</th>
<th data-options="field:'Pcimax',editor:'text',width:80,align:'right' ">Pcimax</th>
<th data-options="field:'Pcimean',editor:'text',width:80,align:'right' ">Pcimean</th>
<th data-options="field:'Pcimin',editor:'text',width:80,align:'right' ">Pcimin</th>
<th data-options="field:'Pcistddev',editor:'text',width:80,align:'right' ">Pcistddev</th>
<th data-options="field:'Numsamp',editor:'numberbox',width:80,align:'right' ">Numsamp</th>
<th data-options="field:'Fatcrk_Ac',editor:'text',width:80,align:'right' ">Fatcrk_Ac</th>
<th data-options="field:'Bleed_Ac',editor:'text',width:80,align:'right' ">Bleed_Ac</th>
<th data-options="field:'Block_Ac',editor:'text',width:80,align:'right' ">Block_Ac</th>
<th data-options="field:'Bumps_Ac',editor:'text',width:80,align:'right' ">Bumps_Ac</th>
<th data-options="field:'Corr_Ac',editor:'text',width:80,align:'right' ">Corr_Ac</th>
<th data-options="field:'Depres_Ac',editor:'text',width:80,align:'right' ">Depres_Ac</th>
<th data-options="field:'Edgecrk_Ac',editor:'text',width:80,align:'right' ">Edgecrk_Ac</th>
<th data-options="field:'Jtrefc_Ac',editor:'text',width:80,align:'right' ">Jtrefc_Ac</th>
<th data-options="field:'Lsdrop_Ac',editor:'text',width:80,align:'right' ">Lsdrop_Ac</th>
<th data-options="field:'Ltcrk_Ac',editor:'text',width:80,align:'right' ">Ltcrk_Ac</th>
<th data-options="field:'Patch_Ac',editor:'text',width:80,align:'right' ">Patch_Ac</th>
<th data-options="field:'Polish_Ac',editor:'text',width:80,align:'right' ">Polish_Ac</th>
<th data-options="field:'Pholes_Ac',editor:'text',width:80,align:'right' ">Pholes_Ac</th>
<th data-options="field:'Rrx_Ac',editor:'text',width:80,align:'right' ">Rrx_Ac</th>
<th data-options="field:'Rut_Ac',editor:'text',width:80,align:'right' ">Rut_Ac</th>
<th data-options="field:'Shove_Ac',editor:'text',width:80,align:'right' ">Shove_Ac</th>
<th data-options="field:'Slpcrk_Ac',editor:'text',width:80,align:'right' ">Slpcrk_Ac</th>
<th data-options="field:'Swell_Ac',editor:'text',width:80,align:'right' ">Swell_Ac</th>
<th data-options="field:'Ravel_Ac',editor:'text',width:80,align:'right' ">Ravel_Ac</th>
<th data-options="field:'Blowup_Pc',editor:'text',width:80,align:'right' ">Blowup_Pc</th>
<th data-options="field:'Cbrk_Pc',editor:'text',width:80,align:'right' ">Cbrk_Pc</th>
<th data-options="field:'Dslab_Pc',editor:'text',width:80,align:'right' ">Dslab_Pc</th>
<th data-options="field:'Dcrk_Pc',editor:'text',width:80,align:'right' ">Dcrk_Pc</th>
<th data-options="field:'Fault_Pc',editor:'text',width:80,align:'right' ">Fault_Pc</th>
<th data-options="field:'Jsdam_Pc',editor:'text',width:80,align:'right' ">Jsdam_Pc</th>
<th data-options="field:'Lsdrop_Pc',editor:'text',width:80,align:'right' ">Lsdrop_Pc</th>
<th data-options="field:'Lincrk_Pc',editor:'text',width:80,align:'right' ">Lincrk_Pc</th>
<th data-options="field:'Lpatch_Pc',editor:'text',width:80,align:'right' ">Lpatch_Pc</th>
<th data-options="field:'Spatch_Pc',editor:'text',width:80,align:'right' ">Spatch_Pc</th>
<th data-options="field:'Polish_Pc',editor:'text',width:80,align:'right' ">Polish_Pc</th>
<th data-options="field:'Popout_Pc',editor:'text',width:80,align:'right' ">Popout_Pc</th>
<th data-options="field:'Pump_Pc',editor:'text',width:80,align:'right' ">Pump_Pc</th>
<th data-options="field:'Pout_Pc',editor:'text',width:80,align:'right' ">Pout_Pc</th>
<th data-options="field:'Rrx_Pc',editor:'text',width:80,align:'right' ">Rrx_Pc</th>
<th data-options="field:'Mapcrk_Pc',editor:'text',width:80,align:'right' ">Mapcrk_Pc</th>
<th data-options="field:'Shrcrk_Pc',editor:'text',width:80,align:'right' ">Shrcrk_Pc</th>
<th data-options="field:'Cspall_Pc',editor:'text',width:80,align:'right' ">Cspall_Pc</th>
<th data-options="field:'Jspall_Pc',editor:'text',width:80,align:'right' ">Jspall_Pc</th>

        </thead>
    </table>
   
    <!--测试数据命令-->
    <div id="tb">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="T_RdpciEdit(-1)">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="T_RdpciEdit(0)">编辑</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="T_RdpciDel()">删除</a>
	    <input id="cmbRegion" class="easyui-combotree" style="width:300px" data-options="prompt:'行政区划',url:'/api/data/regioncode',method:'get',onChange:search"/>
	    <input id="checkDate" class="easyui-datebox"  data-options="prompt:'观测日期',onChange:search"/>
	    <select id="cmbDirection" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'调查方向',url:'/api/data/direction',method:'get',valueField:'id',textField:'text',onChange:search">
         </select>
    </div>

    <!--测试详细页面-->
    <div id="dlg" class="easyui-dialog" title="保存数据" style="width:320px;height:250px;padding:10px" closed="true"  data-options="
				iconCls: 'icon-save',
				buttons: '#dlg-buttons'
			">
        <form id="fm" method="post" action="/api/rdpci">
            <table>
			     
        <tr>
            <td>路段Id:</td>
            <td><input name='Segid' class='easyui-validatebox numberbox' /></td>
        </tr>

        <tr>
            <td>设备:</td>
            <td><input name='Device' class='easyui-validatebox ' /></td>
        </tr>

        <tr>
            <td>Survtype:</td>
            <td><input name='Survtype' class='easyui-validatebox ' /></td>
        </tr>

        <tr>
            <td>Pcidate:</td>
            <td><input name='Pcidate' class='easyui-validatebox datebox' /></td>
        </tr>

        <tr>
            <td>Pcilane:</td>
            <td><input name='Pcilane' class='easyui-validatebox ' /></td>
        </tr>

        <tr>
            <td>Pcimax:</td>
            <td><input name='Pcimax' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Pcimean:</td>
            <td><input name='Pcimean' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Pcimin:</td>
            <td><input name='Pcimin' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Pcistddev:</td>
            <td><input name='Pcistddev' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Numsamp:</td>
            <td><input name='Numsamp' class='easyui-validatebox numberbox' /></td>
        </tr>

        <tr>
            <td>Fatcrk_Ac:</td>
            <td><input name='Fatcrk_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Bleed_Ac:</td>
            <td><input name='Bleed_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Block_Ac:</td>
            <td><input name='Block_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Bumps_Ac:</td>
            <td><input name='Bumps_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Corr_Ac:</td>
            <td><input name='Corr_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Depres_Ac:</td>
            <td><input name='Depres_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Edgecrk_Ac:</td>
            <td><input name='Edgecrk_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Jtrefc_Ac:</td>
            <td><input name='Jtrefc_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Lsdrop_Ac:</td>
            <td><input name='Lsdrop_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Ltcrk_Ac:</td>
            <td><input name='Ltcrk_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Patch_Ac:</td>
            <td><input name='Patch_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Polish_Ac:</td>
            <td><input name='Polish_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Pholes_Ac:</td>
            <td><input name='Pholes_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Rrx_Ac:</td>
            <td><input name='Rrx_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Rut_Ac:</td>
            <td><input name='Rut_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Shove_Ac:</td>
            <td><input name='Shove_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Slpcrk_Ac:</td>
            <td><input name='Slpcrk_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Swell_Ac:</td>
            <td><input name='Swell_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Ravel_Ac:</td>
            <td><input name='Ravel_Ac' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Blowup_Pc:</td>
            <td><input name='Blowup_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Cbrk_Pc:</td>
            <td><input name='Cbrk_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Dslab_Pc:</td>
            <td><input name='Dslab_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Dcrk_Pc:</td>
            <td><input name='Dcrk_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Fault_Pc:</td>
            <td><input name='Fault_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Jsdam_Pc:</td>
            <td><input name='Jsdam_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Lsdrop_Pc:</td>
            <td><input name='Lsdrop_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Lincrk_Pc:</td>
            <td><input name='Lincrk_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Lpatch_Pc:</td>
            <td><input name='Lpatch_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Spatch_Pc:</td>
            <td><input name='Spatch_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Polish_Pc:</td>
            <td><input name='Polish_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Popout_Pc:</td>
            <td><input name='Popout_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Pump_Pc:</td>
            <td><input name='Pump_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Pout_Pc:</td>
            <td><input name='Pout_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Rrx_Pc:</td>
            <td><input name='Rrx_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Mapcrk_Pc:</td>
            <td><input name='Mapcrk_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Shrcrk_Pc:</td>
            <td><input name='Shrcrk_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Cspall_Pc:</td>
            <td><input name='Cspall_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>Jspall_Pc:</td>
            <td><input name='Jspall_Pc' class='easyui-validatebox textbox' /></td>
        </tr>

		    </table>
        </form>
    </div>

    <!--编辑数据命令-->
    <div id="dlg-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:sumbitData($('#dg'),$('#dlg'))">保存</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:$('#dlg').dialog('close')">取消</a>
	</div>
</asp:Content>
